<html>
<head><meta charset="utf-8"><title>rustc guide intern identifiers · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html">rustc guide intern identifiers</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="172530656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172530656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172530656">(Aug 05 2019 at 19:26)</a>:</h4>
<p>Hi everyone, I'm reading the rustc guide, and came across the phrase "interns identifiers" (from <a href="https://rust-lang.github.io/rustc-guide/the-parser.html" target="_blank" title="https://rust-lang.github.io/rustc-guide/the-parser.html">https://rust-lang.github.io/rustc-guide/the-parser.html</a> , the last sentence on that page). What does it mean for something to be interned?</p>



<a name="172531020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172531020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172531020">(Aug 05 2019 at 19:31)</a>:</h4>
<p>It means that you are not creating a heap allocation for an identifier every time, but instead have a global table where they are stored and deduplicated. You then just need to store the index into the global table whenever you have an identifier</p>



<a name="172531426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172531426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172531426">(Aug 05 2019 at 19:36)</a>:</h4>
<p>Thanks!</p>



<a name="172532200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172532200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172532200">(Aug 05 2019 at 19:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116114">@Paul Faria</span> <span class="user-mention" data-user-id="124288">@oli</span> if this is not entirely clear in the guides may it worth opening a PR and explaining it better? :)</p>



<a name="172532343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172532343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172532343">(Aug 05 2019 at 19:49)</a>:</h4>
<p>I'm collecting some notes on my first read through, I'll share them here and then we could create PR's based on that?</p>



<a name="172532351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172532351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172532351">(Aug 05 2019 at 19:49)</a>:</h4>
<p>definitely</p>



<a name="172532353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustc%20guide%20intern%20identifiers/near/172532353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustc.20guide.20intern.20identifiers.html#172532353">(Aug 05 2019 at 19:49)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>